package com.goodmr.passport.password;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.sql.Timestamp;

/**
 * 密码数据实体
 *
 * @author <a href="mailto:bingdong13@msn.com">bigo</a>
 */
@Entity
@Table(name = "password")
@Data
class PasswordEntity {

    /**
     * 帐号Id
     */
    @Id
    @Column(name = "account_id", length = 20, nullable = false)
    private Long accountId;

    /**
     * 认证密码
     */
    @Column(length = 128, nullable = false)
    private String password;

    /**
     * 随机数，用于做安全性加密
     */
    @Column(name = "salt_hash", length = 64, nullable = false)
    private String saltHash;

    /**
     * 创建时间
     */
    @Column(name = "created_at", nullable = false, updatable = false)
    private Timestamp createdAt;

    /**
     * 更新时间
     */
    @Column(name = "updated_at", nullable = false)
    private Timestamp updatedAt;
}
